package cn.yerly.sakura.repository;

import cn.yerly.sakura.domain.TradeItem;
import org.springframework.data.jpa.repository.*;

import java.util.List;

/**
 * Spring Data JPA repository for the TradeItem entity.
 */
public interface TradeItemRepository extends JpaRepository<TradeItem,Long> {

    @Query("select tradeItem from TradeItem tradeItem where tradeItem.user.login = ?#{principal.username}")
    List<TradeItem> findAllForCurrentUser();

}
